#include <stdio.h>
#include <math.h>
#include <stdlib.h>
void score(int, int, int);
void cardnumber(int);
int main()
{
    while (1)
    {
        int a[3];
        for (int i = 0; i <= 2; i++)
        {
            cardnumber(i);
            char card[2];
            scanf("%s", card);
            switch (card[0])
            {
            case 'A':
            case 'a':
                a[i] = 1;
                break;
            case 'J':
            case 'j':
            case 'Q':
            case 'q':
            case 'K':
            case 'k':
                a[i] = 10;
                break;
            default:
                a[i] = atoi(card);
            }
        }
        score(a[0], a[1], a[2]);
    }
    return 0;
}

void score(int a, int b, int c)
{
    int sum;
    sum = a + b + c;
    if (a == 1 || b == 1 || c == 1)
    {
        if (sum >= 3 && sum <= 11)
        {
            sum = sum + 10;
            printf("your score is %d\n", sum);
        }
        else
        {
            printf("your score is %d\n", sum);
        }
    }
    else
    {
        if (sum > 21)
        {
            printf("your score >21");
        }
        else
        {
            printf("your score is %d\n", sum);
        }
    }
}
void cardnumber(int i)
{
    if (i == 0)
    {
        printf("your first card is\n");
    }
    else if (i == 1)
    {
        printf("your second card is\n");
    }
    else if (i == 2)
    {
        printf("your third card is\n");
    }
}
